package com.isoft.systemprovidor.controller;

import com.isoft.systemprovidor.entity.SysUser;
import com.isoft.systemprovidor.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/systemprovidor/sysuser")
public class SysUserController {
    @Autowired
    SysUserService sysUserService;
    /*无安全框架登录测试*/
    @PostMapping("logintest")
    public SysUser loginTest(String username ,String password){
        return sysUserService.loginTest(username,password);
    }

    /*获取所有用户信息*/
    @GetMapping("getall")
    public List<SysUser> getAllSysUser(){
        return  sysUserService.getAllSysUser();
    }
    /*根据ID获取用户信息*/
    @GetMapping("{sysuid}")
    public SysUser getById(@PathVariable("sysuid") Integer id){
        return sysUserService.getById(id);
    }
}
